package Main;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.ServletActionContext;

import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

import com.opensymphony.xwork2.ActionSupport;
import com.zhuanyongjin.dao.membersDao;
import com.zhuanyongjin.dao.platform_activityDao;
import com.zhuanyongjin.dao.impl.membersDaoImpl;
import com.zhuanyongjin.dao.impl.platform_activityDaoImpl;

public class TestAction extends ActionSupport{

	/**
	 * @param args
	 */
	public void GetSidebar() throws IOException {
		HttpServletResponse response = ServletActionContext.getResponse();
		HttpServletRequest request = ServletActionContext.getRequest();
		response.setCharacterEncoding("UTF-8");
		response.setContentType("text/html");
		PrintWriter out = response.getWriter();
		platform_activityDao pa=new platform_activityDaoImpl();
		String category_id=request.getParameter("cat_id");
		List list1=pa.queryGetSidebar(category_id);
		JSONArray json=JSONArray.fromObject(list1);	
		out.print(json);
		out.flush();
		out.close();
	}

}
